{extend name="base" /}

{block name="title"}土豪区冻结{/block}

{block name="main"}
<div class="main">
	<div class="wdtx_header">
		<div class="container">
			<div class="qbgl_box clearfix">
				
				<div class="qbye">
					<div class="img_box">
						<img src="/images/qb.png"/>
					</div>
					<span>账户余额：<span class="color_ceng">{$sumUserWalletUpstartFreeze}</span></span>
				</div>
			</div>
			
			<div class="qb_info">
				<ul class="breadcrumb">
				  <li><a href="/user_info">绑定云付通</a></li>
				  <li><a href="/user_info/change_password">修改密码</a></li>
				  <li><a href="/user_info">修改个人信息</a></li>
				</ul>
			</div>
			
		</div>
	</div>
	<div class="container">
		<div class="qd_box">
			<div class="table_modal">

				<div class="tab_title">
					<p>土豪区冻结</p>
				</div>

				<div class="qd_table_box">
					<div class="table-responsive">
					  	<table class="table text-center table-bordered">
					    	<tr>
					    		<th>流水号</th>
					    		<th>冻结金额</th>
					    		<!--<th>冻结利息</th>-->
					    		<th>开始时间</th>
					    		<th>解冻时间</th>
					    		<th>是否解冻</th>
					    		<th>操作</th>
					    	</tr>
							{volist name='userWalletUpstartFreezes' id='userWalletUpstartFreeze'}
								{if condition="$userWalletUpstartFreeze->getData('is_freeze') neq 1"}
									{php}$freezeOperate = json_decode($userWalletUpstartFreeze -> freeze_operate, true);{/php}
									{foreach name="freezeOperate" item="value" key="key"}
										<tr>
											<td>{$userWalletUpstartFreeze.user_wallet_upstart_freeze_id}-{$key}</td>
								    		<td>{$value.price}</td>
								    		<td>{$value.create_time|date="Y-m-d H:i:s",###}</td>
						    				<td>{$value.end_time|date="Y-m-d H:i:s",###}</td>
								    		<td>{$userWalletUpstartFreeze.is_freeze}</td>
											{if condition="$value['is_draw'] eq 1"}
							    				<td>已领取</td>
							    			{else /}
							    				{if condition="$value['end_time'] elt time()"}
							    					{if condition="!isset($freezeOperate[$key-1])"}
							    						<td><a href="/withdraw/upstart/draw?user_wallet_upstart_freeze_id={$userWalletUpstartFreeze.user_wallet_upstart_freeze_id}&key={$key}">可领取</a></td>
							    					{else /}
							    						{if condition="$freezeOperate[$key-1]['is_draw'] eq 1"}
							    							<td><a href="/withdraw/upstart/draw?user_wallet_upstart_freeze_id={$userWalletUpstartFreeze.user_wallet_upstart_freeze_id}&key={$key}">可领取</a></td>
							    						{else /}
							    							<td>未领取</td>
							    						{/if}
							    					{/if}
							    				{else /}
							    					<td>未领取</td>
							    				{/if}
											{/if}
								    	</tr>
									{/foreach}
						    	{else /}
						    		<tr>
							    		<td>{$userWalletUpstartFreeze.user_wallet_upstart_freeze_id}</td>
							    		<td>{$userWalletUpstartFreeze.price + $userWalletUpstartFreeze.interest}</td>
							    		<td>{$userWalletUpstartFreeze.begin_time|date="Y-m-d H:i:s",###}</td>
							    		<td>{$userWalletUpstartFreeze.end_time|date="Y-m-d H:i:s",###}</td>
							    		<td>{$userWalletUpstartFreeze.is_freeze}</td>
							    		<td>已领取</td>
							    	</tr>
						    	{/if}
							{/volist}
					  	</table>
					</div>
					<nav>{$userWalletUpstartFreezes -> render()}</nav>
				</div>
			</div>
		</div>	
	</div>

</div>
{/block}